home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / prog / strpchrt.arj / SC.H < prev    next >
Text File  |  1993-06-19  |  4KB  |  117 lines

  1. /* Include file for the Strip Chart Library */
  2.  
  3. extern double SC_yoffset; /* current window starting position */
  4.  
  5. struct SC_Window {
  6.    int type; /* window type */
  7.    int pymin, pymax; /* window position in PC */
  8.    void *window; /* window data structure */
  9.    struct SC_Window *next; /* linked list */
  10. };
  11.  
  12. typedef struct SC_Window SC_WINDOW;
  13.  
  14. /* Printer resolution codes */
  15. #define SC_LOW_RES 0  /* low resolution mode */
  16. #define SC_HIGH_RES 1 /* high resolution mode */
  17.  
  18. /* Printer type codes */
  19. #define SC_9PIN 9      /* 9 pin printer */
  20. #define SC_24PIN 24    /* 24 pin printer */
  21.  
  22. /* Printer ports */
  23. #define LPT1 0
  24. #define LPT2 1
  25. #define LPT3 2
  26.  
  27. /* Marker Types */
  28. #define SCM_PULSE 0
  29. #define SCM_TICK 1
  30. #define SCM_BAR 2
  31. #define SCM_BARLINE 3
  32.  
  33.  /* Window types */
  34. #define SC_TRACE 1
  35. #define SC_TEXT 2
  36. #define SC_EVENT 3
  37. #define SC_TIME 4 /* time axis with labels and ticks */
  38. #define SC_TITLE 5 /* constant, periodic text */
  39.  
  40. /* Line types */
  41. #define LIGHT_LINE  8
  42. #define MEDIUM_LINE  4
  43. #define SOLID_LINE 0
  44.  
  45. /* Fill types */
  46. #define NO_FILL -1
  47. #define SOLID_FILL 0
  48. #define HALF_FILL 4
  49.  
  50. /* Flags */
  51. #define SCF_NOFLAGS 0 /* no flags */
  52. #define SCF_BORDER 1 /* Border around window */
  53. #define SCF_GRID 2 /* Show grids */
  54. #define SCF_YLABEL 4 /* Label horizontal grids */
  55. #define SCF_CLIP 8 /* Enable clipping */
  56.  
  57. /* Time label types */
  58. #define LABELS_BELOW_AXIS 0
  59. #define LABELS_ABOVE_AXIS 1
  60.  
  61. /* Units Types */
  62. #define INCHES 1.0
  63. #define CENTIMETERS (1.0/2.54)
  64.  
  65. /* Error codes */
  66. #define SCE_NO_ERROR 0
  67. #define SCE_OUT_OF_MEMORY 1
  68. #define SCE_INCORRECT_WINDOW_TYPE 2 /* incorrect window type for the function */
  69. #define SCE_INVALID_TRACE_RANGE 3 /* ymin must not equal ymax */
  70. #define SCE_INVALID_WINDOW_OFFSET 4 /*  yoffset must be > 0 */
  71. #define SCE_INVALID_WINDOW_HEIGHT 5 /*  yheight must be > 0 */
  72. #define SCE_INVALID_PRINTER 6  /* SC_Init: the indicated printer type and  resolution is not supported */
  73. #define SCE_INVALID_TIME_INTERVAL 7 /* time interval must be > 0 */
  74. #define SCE_INVALID_HGRID_DIV 8 /* horizontal grid divisions must be >= 1 */
  75. #define SCE_NULL_STRING 9 /* tried to pass a null pointer */
  76. #define SCE_INVALID_CHAR_HEIGHT 10 /* char height must be > 0 */
  77.  
  78.  
  79. /*-------------------------------------------------*/
  80. /* Function Prototypes for User Functions          */
  81. /*-------------------------------------------------*/
  82.  
  83. extern SC_WINDOW *SC_AddEventWindow(double yoffset, double yheight,
  84.    int markerType, int fillType, int *error);
  85. extern void SC_Event(SC_WINDOW *eventWindow, int evtlevel, int *error);
  86. extern SC_WINDOW *SC_AddTimeWindow(double yoffset,
  87.    double yheight, int type, double tickInterval, int minorDiv,
  88.    char * (*labelFunc)(SC_WINDOW *timeWindow,double elapsedTime,
  89.       unsigned long labelCount),
  90.    int *error);
  91. extern SC_WINDOW *SC_AddTextWindow(double yoffset,double yheight,
  92.    int *error);
  93. extern void SC_Text(SC_WINDOW *textWindow,char *s,int *error);
  94. extern SC_WINDOW *SC_AddTraceWindow(double yoffset, double yheight,
  95.    double ymin, double ymax, unsigned int flags, int *error);
  96. extern void SC_SetTraceRange(SC_WINDOW *traceWindow,
  97.    double ymin, double ymax, int *error);
  98. extern void SC_Trace(SC_WINDOW *traceWindow, double scan, int *error);
  99. extern void SC_Draw(void);
  100. extern void SC_Advance(double sec);
  101. extern void SC_Close(void);
  102. extern void SC_Init(int port, unsigned char printerType,
  103.    unsigned char plotResolution, double units, double plotWidth,
  104.    double plotSpeed, int *error);
  105. extern int SC_PrinterReady(int port);
  106. extern void SC_PrintChar(char c);
  107. extern void SC_SetTimeGrids(double seconds, int *error);
  108. extern void SC_SetHorizontalGrids(int divisions, int *error);
  109. extern void SC_SetYlabels(double charHeight, char *format,
  110.    double interval, int *error);
  111. extern void SC_Title(SC_WINDOW *titleWindow,char *title,int *error);
  112. extern SC_WINDOW *SC_AddTitleWindow(double yoffset, double yheight,
  113.    double interval, int *error);
  114. extern char *SC_ErrorMsg(int errCode);
  115. extern void SC_SetErrorTrap(void (*errorFunc)(char *msg));
  116.  
  117.